import Vue from 'vue';

Vue.filter('dateFormat', (value) => {
    const date = new Date(value);

    const Y = date.getFullYear();
    const M = String(date.getMonth() + 1).padStart(2, '0');
    const D = String(date.getDate()).padStart(2, '0');

    const hh = String(date.getHours()).padStart(2, '0');
    const mm = String(date.getMinutes()).padStart(2, '0');
    const ss = String(date.getSeconds()).padStart(2, '0');
    // 2020-06-15 11:23:10
    return `${Y}-${M}-${D} ${hh}:${mm}:${ss}`;
});
